package cn.lf.controller;


import cn.lf.constant.ResponseCodeEnum;
import cn.lf.entity.SysUser;
import cn.lf.mapper.SysUserMapper;
import cn.lf.utils.ResponseModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author guoyy
 * @since 2024-04-01
 */
@RestController
@RequestMapping("/sysuser/")
@Api(tags = "ceshi")
public class ApiTestController {

    @Resource
    private SysUserMapper sysUserMapper;

    @GetMapping("/test1")
    @ApiOperation("测试")
    public ResponseModel<String> test(@RequestParam String t){

        SysUser sysUser = new SysUser();

        sysUser.setUserName(t);

        sysUserMapper.insert(sysUser);

        return new ResponseModel(ResponseCodeEnum.SUCCESS.getCode(),ResponseCodeEnum.SUCCESS.getMsg(),t);
    }

}
